﻿using System;
using AOT.Game.Timer;
using AOT.Sound;
using HotUpdate.GUI;
using HotUpdate.Misc;
using HotUpdate.Persistence;
using UnityEngine;
using Wxy.Res;

namespace HotUpdate
{
    public class GameMgr
    {
        public static ScriptTimer Timer;
        public static ResMgr ResMgr;
        public static SoundPlayer SoundPlayer;
        public static PersistenceMgr PersistenceMgr;

        public void Start(GameObject gameObject)
        {
            ResMgr = gameObject.AddComponent<ResMgr>();
            Timer = new ScriptTimer();
            PersistenceMgr = new PersistenceMgr();
            SoundPlayer = UITool.RecursionFindObj(gameObject.transform, "SoundPlayer").GetComponent<SoundPlayer>();
            SoundPlayer.Init(ResMgr,Timer);
            UIMgr.Start();
        }
        public void Update()
        {
            UIMgr.Update();
            Timer.Tick();
        }
    }
}